package com.wenzheng.quartz.task.entity;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * 定时任务基类
 * @author
 * @version 1.0
 */
public abstract class BaseTask implements Job{

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		// TODO 某些场景下，可能需要添加分布式锁
		this.runTask(context);
	}
	
	// 因此子类直接重写runTask方法就ok了
	public abstract void runTask(JobExecutionContext context);

	

}
